package com.example.communist_app_api.db.dao;


import com.example.communist_app_api.db.dto.ActivityDTO;
import com.example.communist_app_api.db.dto.ActivityUniAppShowDTO;
import com.example.communist_app_api.db.pojoDto.Activity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ActivityDao {

    Integer insert(Activity activity);

    List<ActivityDTO> selectByCommon(@Param("activity") Activity activity,@Param("organizationIdList") List organizationIdList);

    Integer updateActivity(Activity activity);

    Integer deleteActivity(Integer id);

    ActivityDTO selectActivityById(Integer id);

    //只筛选可报名状态
    List<ActivityUniAppShowDTO> selectActivityByUniAppAndAdmit(@Param("title") String title ,
                                                               @Param("date") Date date,
                                                               @Param("organizationIdList") List organizationIdList);
    //只筛选结束报名状态
    List<ActivityUniAppShowDTO> selectActivityByUniAppAndForbid(@Param("title")String title,
                                                                @Param("date")Date date,
                                                                @Param("organizationIdList") List organizationIdList);

    Integer getLimitedNumByActivityId(Integer activityId);
}
